package org.lewis.action;

import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;

@Namespace("/")
@Results({
        @Result(name = "success", type = "dispatcher", location = "/hello.jsp"),
        @Result(name = "sayHi", type = "dispatcher", location = "/hi.jsp")
})
public class HelloWorldAction extends ActionSupport {

    @Action(value = "hello")
    public String execute() throws Exception {
        return SUCCESS;
    }

    @Action(value = "hi")
    public String sayHi() {
        return "sayHi";
    }

}
